Repository navigation
d3d12: test bundle ExecuteIndirect(DISPATCH) and fix the stale bundle note (D3D-BUNDLE-EXECUTE-INDIRECT) - #2575
Conversation
… note (D3D-BUNDLE-EXECUTE-INDIRECT) ExecuteIndirect in a bundle is already deferred on main (single DRAW, DRAW_INDEXED, DISPATCH or DISPATCH_MESH, no count buffer); only DRAW and DRAW_INDEXED had a GPU test and docs/d3d12_vulkan.md still listed it as "Not deferred yet". d3d12_indirect_dispatch_count_test --bundle (ctest d3d12_bundle_indirect_dispatch) runs a fixed-count DISPATCH recorded in a bundle twice from a direct list with a different parent root UAV each time, then a direct Dispatch, on the layer, WARP and the default adapter, and checks that a count buffer or a root-constant signature fails the bundle's Close (E_INVALIDARG on both host adapters, as on the layer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cute-indirect-37f83c
…cute-indirect-37f83c
lixonik
left a comment
There was a problem hiding this comment.
Tested 860eea035 merged locally with main c1ecf04edc on Windows 11, MSVC 19.44, RTX 5070 (610.88). d3d12_bundle_indirect_dispatch, d3d12_indirect_dispatch_count and d3d12_indirect_group_budget passed. WARP, native D3D12 and the Vulkan layer agreed on both bundle variants and refused both invalid signatures with E_INVALIDARG.
I also ran the direct-dispatch retention check described inline. The extra case passed on all three paths.
AI-assisted.
| list->ExecuteBundle(bundle.p); | ||
| list->SetComputeRootUnorderedAccessView(0, va + kSlot); | ||
| list->ExecuteBundle(bundle.p); | ||
| list->SetComputeRootUnorderedAccessView(0, va + 2 * kSlot); |
There was a problem hiding this comment.
The test description says the parent's UAV remains bound after ExecuteBundle. This explicit rebind makes the existing readback unable to detect losing that argument. I added a UAV barrier and a direct dispatch immediately after the second ExecuteBundle, before changing the UAV. The resulting 6/10 7/11 1/1 passed on the Vulkan layer, WARP and native D3D12 in both same_root modes. Could the fixture keep that extra readback check?
There was a problem hiding this comment.
Added in b544769 (UAV barrier and a direct Dispatch(1, 1, 1) right after the second ExecuteBundle, before any rebind): 6/10 7/11 1/1 on the layer, WARP and native D3D12 (RTX 4060, 610.88) in both same_root cases, merged with current main in 3c108a3. Thanks. AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.
…rect (review on ProjectLeonida#2575) After the second ExecuteBundle, a UAV barrier and a direct Dispatch run before any rebind, so slot 1 holds 7/11 only if the parent's root UAV survived the bundle. Layer, WARP and the default adapter (RTX 4060, 610.88) give 6/10 7/11 1/1 in both same_root cases, as measured by the reviewer on an RTX 5070. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cute-indirect-37f83c
lixonik
left a comment
There was a problem hiding this comment.
Re-reviewed 3c108a339 (including b5447692f and the main merge) and verified on RTX 5070 with Khronos validation enabled.
Code audit:
runtime/test/d3d12_indirect_dispatch_count_test.cpp,docs/d3d12_vulkan.md: adding the UAV barrier and directDispatch(1, 1, 1)immediately after the secondExecuteBundlewithout rebinding cleanly proves the parent's root UAV survives the bundle (6/10 7/11 1/1in bothsame_rootmodes across the Vulkan layer, WARP, and native D3D12).
Verification at 3c108a339 (Windows 11, MSVC 19.44, Ninja Release, LEONIDA_VK_VALIDATION=1):
- Built
d3d12_indirect_dispatch_count_test. ctest -R '^(d3d12_bundle_indirect_dispatch|d3d12_indirect_dispatch_count|d3d12_indirect_group_budget)$': 3/3 passed (0 validation errors).python -I scripts/check_no_game_data.py: passed.
GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341, VK_LAYER_KHRONOS_validation 1.4.363).
AI-assisted (Antigravity, Gemini).
|
@DadaCap could you review this one when you have a moment? It merges cleanly with AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes. |
Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (
|
|
Re-checked on
Tested
Nit: the description still says 6/10 6/10 1/1. Since No blocker from my side. AI-assisted (Claude Code). |
timbot103
left a comment
There was a problem hiding this comment.
Static audit of 3c108a339 against 48bae6cad. The two bundle calls and the direct follow-up cover the parent root UAV and bundle PSO behavior.
In run_bundle, the upload ends after the third record, so an extra indirect dispatch can read a zero-group fourth record and leave the counters unchanged. Could you upload a fourth valid record such as (4, 1, 1) while still passing MaxCommandCount = 3? The expected counters can stay the same.
AI-assisted.
|
Linux GPU check and fourth-record control for the review above. With I tested the suggested fourth record in a local fixture-only copy. I initialized and copied four records and kept Khronos validation 1.4.363.1 was loaded by the Linux Vulkan loader. The one host-layer VUID across these runs was the same device-creation extension dependency ( |
Claimed in the coordination issue as: D3D-BUNDLE-EXECUTE-INDIRECT (#2570 (comment))
Item: D3D-BUNDLE-EXECUTE-INDIRECT
What and why
Doc fix and regression test, no shim code change.
ExecuteIndirectin a bundle is already deferred on main(ba62682): a single DRAW, DRAW_INDEXED, DISPATCH or DISPATCH_MESH operation with no count buffer plays at each
ExecuteBundlewith the parent's state at that call. Only DRAW/DRAW_INDEXED had a GPU test, anddocs/d3d12_vulkan.md(bundles) still listed it as "Not deferred yet". A test failing on main is therefore notpossible; the new test instead fails when the bundle branch of
ExecuteIndirectis disabled.d3d12_indirect_dispatch_count_test --bundle(ctestd3d12_bundle_indirect_dispatch): a fixed-count DISPATCHrecorded in a bundle, executed twice from a direct list with a different parent root UAV each time, then a direct
Dispatch. The layer, WARP and the default adapter all give 6/10 7/11 1/1, with and without the bundle setting theparent's root signature first. A count buffer or a root-constant signature fails the bundle's
ClosewithE_INVALIDARGon both host adapters, as on the layer.ExecuteIndirectsection points tothe new test.
Tested
On the branch merged with current main: the new test,
d3d12_bundle_test(default,--indirect-bundle-layer,--indirect-bundle-warp),d3d12_bundle_forbidden_testandd3d12_indirect_dispatch_count_testpass. With thebundle branch of
ExecuteIndirectdisabled, the new test and--indirect-bundle-layerfail.check_no_game_data.pyis clean on the three files.GPUs tested: NVIDIA GeForce RTX 4060, driver 610.88, Windows 11 10.0.26300.9974; WARP on the same machine.
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code